class Solution(object):
    def removeDuplicates(self, nums):
        if len(nums)<3 :
            return len(nums)
        slow=0
        for fast in nums:
            if(slow<2 or fast!=nums[slow-2]):
                nums[slow]=fast
                slow+=1
        return slow
x=Solution()
print(x.removeDuplicates([0,0,1,1,1,1,2,3,3]))